import type { FormRules } from "naive-ui";
import { requiredRule } from "@/utils";

export const catalogRules: FormRules = {
  name: requiredRule("请输入目录名称"),
  order: {
    type: "number",
    ...requiredRule("请输入排序"),
  },
  routeName: requiredRule("请输入路由名称"),
};

export const pageRules: FormRules = {
  name: requiredRule("请输入页面名称"),
  order: {
    type: "number",
    ...requiredRule("请输入排序"),
  },
  routeName: requiredRule("请输入路由名称"),
  routePath: requiredRule("请输入路由路径"),
  component: requiredRule("请选择菜单组件"),
  newTab: {
    type: "boolean",
    ...requiredRule("请选择打开方式"),
  },
};

export const buttonRules: FormRules = {
  name: requiredRule("请输入按钮名称"),
  order: {
    type: "number",
    ...requiredRule("请输入排序"),
  },
};
